import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from 'axios'
import qs from 'qs'
import md5 from 'js-md5'

import $ from 'jquery';
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap/dist/js/bootstrap.min.js";
import './theme/element-#1EB450/index.css'

import * as echarts from 'echarts'
import china from '../public/ChinaMapData/china.json';
echarts.registerMap('china', china);


var app = createApp(App)

axios.defaults.baseURL = "http://49.232.135.8:8088/back/"

app.config.globalProperties.$axios = axios
app.config.globalProperties.$qs = qs
app.config.globalProperties.$md5=md5
app.config.globalProperties.$echarts = echarts

app.use(ElementPlus)
app.use(router).mount('#app')

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
